package com.banmajio.controller;

import java.util.List;

import com.banmajio.bean.Kde03;
import com.banmajio.mapper.Kde03Mapper;
import com.banmajio.service.DataTransService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/trans")
public class TransController {

	@Autowired
	private Kde03Mapper kdeMapper;

	@Autowired
	private DataTransService dataTransService;

	@RequestMapping("/select")
	public List<Kde03> select() {
		Integer count = kdeMapper.getCount();
		log.info("kde03共有:{}条数据", count);
		List<Kde03> kde03List = kdeMapper.getUser();
		log.info("查询到数据kde03List:{}", kde03List);
		return kde03List;
	}

	@GetMapping("/invoke")
	public String updateExtendInfo(){
		System.out.println("调用成功~~~");
		return "success";
	}

	@GetMapping("/printData")
	public String printData(){
		System.out.println("调用成功~~~");
		dataTransService.printDataKdp01();
		return "success";
	}

	@GetMapping("/transData")
	public String transData(){
		System.out.println("调用成功~~~");
		dataTransService.getKdp01List();
		return "success";
	}

	@GetMapping("/transDataKde03")
	public String transDataKde03(){
		System.out.println("调用成功~~~");
		dataTransService.getKde03List();
		return "success";
	}

}
